<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #day {
            font-size: 30px;
            font-weight: 600;
            text-align: center;
        }
    </style>
</head>

<body>
    <div>
        <p id="day"></p>
    </div>
    <script>
        let day = document.querySelector("#day")
        let body = document.querySelector("body")
        let res = setInterval(function () {
            let time1 = new Date();
            let time2 = new Date("2022-9-29 00:00:00")
            let dTime = time2 - time1;
            let day1 = dTime / (1000 * 60 * 60 * 24)
            day1 = Math.floor(day1);
            let dHours = parseInt(dTime / (1000 * 60 * 60) % 24)
            let dMin = parseInt(dTime / 1000 / 60 % 60)
            let second = parseInt(dTime / 1000 % 60)
            day.innerText = `距离下次疯狂星期四还剩\n${day1}天${dHours}小时${dMin}分${second}秒`
        
            let a = Math.floor(Math.random() * 255);
            let b = Math.floor(Math.random() * 255);
            let c = Math.floor(Math.random() * 255);
            day.style.color = `rgba(${a},${b},${c})`
            body.style.backgroundColor = `rgba(${c},${a},${b})`
        },1000);


    </script>
</body>

</html>